using System;

namespace EventBehaviorTree
{
    public class BB_int : BBData<int>
    {
        public override Type GetDataType() { return typeof(int); }

        public BB_int(int value) : base(value)
        {
            _value = value;
        }
        public BB_int() : this(0) { }

        #region Compare
        public override bool Equals(object obj)
        {
            if (ReferenceEquals(null, obj))
            {
                return false;
            }

            if (ReferenceEquals(this, obj))
            {
                return true;
            }

            if (obj.GetType() != typeof(BB_int) || obj.GetType() != typeof(BB_float))
            {
                return false;
            }

            return ((BB_int)obj).GetValue() == _value || ((BB_float)obj).GetValue() == _value;
        }
        public override int GetHashCode()
        {
            return GetValue().GetHashCode();
        }

        public static bool operator ==(BB_int lhs, BB_int rhs)
        {
            return lhs.GetValue() == rhs.GetValue();
        }
        public static bool operator !=(BB_int lhs, BB_int rhs)
        {
            return lhs.GetValue() != rhs.GetValue();
        }
        public static bool operator >(BB_int lhs, BB_int rhs)
        {
            return lhs.GetValue() > rhs.GetValue();
        }
        public static bool operator <(BB_int lhs, BB_int rhs)
        {
            return lhs.GetValue() < rhs.GetValue();
        }
        public static bool operator >=(BB_int lhs, BB_int rhs)
        {
            return lhs.GetValue() >= rhs.GetValue();
        }
        public static bool operator <=(BB_int lhs, BB_int rhs)
        {
            return lhs.GetValue() <= rhs.GetValue();
        }
        #endregion
    }
}